package com.itheima.controller;

import com.itheima.po.LoginParam;
import com.itheima.pojo.Result;
import com.itheima.service.LoginService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/login")
public class LoginController {
    @Resource
    LoginService loginService;
    /**
     * 登录认证
     */
    @PostMapping()
    public Result login(@Validated @RequestBody LoginParam emp) {
        log.info("emp:{}", emp);
        return loginService.login(emp);
    }

}
